package com.zds.hj.poseidon.biz.common;

import com.zds.hj.crm.facade.dto.customer.req.EnterpriseCustomerReqDto;
import com.zds.hj.crm.facade.dto.customer.resp.EntCustomerBusinessRespDto;
import com.zds.hj.crm.facade.dto.customer.resp.EntCustomerCreateQueryRespDto;
import com.zds.hj.crm.facade.interfaces.customer.EnterpriseCustomerBusinessInterface;
import com.zds.hj.crm.facade.interfaces.customer.EnterpriseCustomerInterface;
import com.zds.zly.common.constant.CommConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * crm的接口
 */
@Slf4j
@Service
public class CrmServiceInterface {

    @DubboReference(owner = CommConstant.DUBBO_OWNER, version = CommConstant.DUBBO_VERSION, timeout = 9999999)
    private EnterpriseCustomerInterface enterpriseCustomerInterface;
    @DubboReference(owner = CommConstant.DUBBO_OWNER, version = CommConstant.DUBBO_VERSION)
    private EnterpriseCustomerBusinessInterface enterpriseCustomerBusinessInterface;
    /**
     * 保存企业客户信息
     * @param dto
     * @return
     */
    public EntCustomerCreateQueryRespDto createAndQueryService(EnterpriseCustomerReqDto dto){
        EntCustomerCreateQueryRespDto andQuery = enterpriseCustomerInterface.createAndQuery(dto);
        return andQuery;
    }


    public EntCustomerBusinessRespDto findByEntId(Long id){
        return enterpriseCustomerBusinessInterface.findByEntId(id);
    }
}
